home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / RTVBE210.ZIP / _VESA.H < prev    next >
C/C++ Source or Header  |  1997-01-06  |  5KB  |  120 lines

  1. /************************************************************************
  2. ; *
  3. ; *     File        : VESA.H
  4. ; *
  5. ; *     Description : Vesa header for VESA 2.00
  6. ; *
  7. ; *     Copyright (C) 1995,96 RealTech
  8. ; *
  9. ; ************************************************************************/
  10. #ifndef _SUPERVGA
  11. #define _SUPERVGA
  12.  
  13. #define LfbMapRealPointer(p) (void*)(((unsigned)(p)>>12)+((p) & 0xFFFF))
  14. #define RGBMask(r,g,b) \
  15. ( (  (r)>>(8-modebuf.RedMaskSize  )) << modebuf.RedFieldPosition   )\
  16. + ( ((g)>>(8-modebuf.GreenMaskSize)) << modebuf.GreenFieldPosition )\
  17. + ( ((b)>>(8-modebuf.BlueMaskSize )) << modebuf.BlueFieldPosition  )
  18. enum {VESACAPA_WideDac=1,VESACAPA_VgaComp=2,VESA_CAPA_Ramdac=4};
  19. enum {VESA_320x200=0x153,VESA_360x200 =0x156,VESA_320x240  =0x154,
  20.       VESA_360x240=0x157,VESA_320x400 =0x155,VESA_360x400  =0x158,
  21.       VESA_640x350=0x11C,VESA_640x400 =0x100,VESA_640x480  =0x101,
  22.       VESA_800x600=0x101,VESA_1024x768=0x105,VESA_1280x1024=107};
  23. enum {VBE_flip,VBE_copy};
  24.  
  25. typedef struct {
  26.     short int  ModeAttributes;
  27.     unsigned char WinAAttributes;
  28.     unsigned char WinBAttributes;
  29.     short int WinGranularity;
  30.     short int WinSize;
  31.     short int WinASegment;
  32.     short int WinBSegment;
  33.     long int WinFuncPtr;
  34.     short int BytesPerLine;
  35.     short int XResolution;             // horizontal resolution
  36.     short int YResolution ;            // vertical resolution
  37.     unsigned char XCharSize;           // character cell width
  38.     unsigned char YCharSize ;          // character cell height
  39.     unsigned char NumberOfPlanes;      // number of memory planes
  40.     unsigned char BitsPerPixel ;       // bits per pixel
  41.     unsigned char NumberOfBanks;       // number of banks
  42.     unsigned char MemoryModel  ;       // memory model type
  43.     unsigned char BankSize      ;      // bank size in kb
  44.     unsigned char NumberOfImagePages;  // number of images
  45.     unsigned char Res1              ;  // reserved for page function
  46.     unsigned char RedMaskSize   ;      // size of direct color red mask in bits
  47.     unsigned char RedFieldPosition ;   // bit position of LSB of red mask
  48.     unsigned char GreenMaskSize    ;   // size of direct color green mask in bits
  49.     unsigned char GreenFieldPosition ; // bit position of LSB of green mask
  50.     unsigned char BlueMaskSize       ; // size of direct color blue mask in bits
  51.     unsigned char BlueFieldPosition  ; // bit position of LSB of blue mask
  52.     unsigned char RsvdMaskSize       ; // size of direct color reserved mask in bits
  53.     unsigned char RsvdFieldPosition  ; // size of direct color reserved mask in bits
  54.     unsigned char DirectColorModeInfo; // Direct Color mode attributes
  55.     long PhysBasePtr;                  // Physical Address for linear buffer
  56.     long OffScreenMemOffset;
  57.     short OffScreenMemSize;
  58.     char res2[206];
  59. }VesaModeInfo;
  60. typedef struct {
  61.     char VESASignature[4];             // 4 signature bytes
  62.     short int VESAVersion;             // VESA version number
  63.     char *OEMStringPtr;                // Pointer to OEM string
  64.     unsigned char Capabilities[4];     // capabilities of the video environment
  65.     void *VideoModePtr;                // pointer to supported Super VGA modes
  66.     short int memory;                  // Number of 64kb memory blocks on board
  67.     short OemSoftwareRev;
  68.     long OemVendorNamePtr;
  69.     long OemProductNamePtr;
  70.     long OemProductRevPtr;
  71.     char Reserved[222];
  72.     char OemDATA [256];
  73. }VesaInfoBlock;
  74. typedef struct {
  75.     uchar *Video;
  76.     uchar bankshift;
  77.     uchar videocard;
  78.     uchar Linear;
  79.     uchar Policy;
  80.     uchar Page;
  81.     uchar Card;
  82.     uchar LFB_actived;
  83.     uchar DAC8bit;
  84.     ulong  offset;
  85.     char  *CardName;
  86.     short selector;
  87.     char FAR48 *LFBPtr;
  88. }VesaSystem;
  89.  
  90. #ifdef __cplusplus
  91. extern "C" {
  92.     #endif
  93.  
  94.     int VBE_get_LFB_infos(void);
  95.     int VBE_set_gfx_mode(int VESAmode);
  96.     int VBE_set_vesa_mode(int VESAmode);
  97.     int VBE_get_infos(int VESAmode);
  98.     int VBE_get_mode_by_infos(int width,int height,int bbp);
  99.     int VBE_set_mode(int mode);
  100.     int VBE_get_OEM_infos(void);
  101.     int VBE_set_vesa_mode(int VESAmode);
  102.     bool VBE_set8BitPalette(void);
  103.     bool VBE_set6BitPalette(void);
  104.     void CALLING_C VBE_set_palette(ulong a, ulong b, void * pal);
  105.     void VBE_get_palette(int start, int num, uchar *palbuf);
  106.     void CALLING_C BITBLT_xflipVESA(void);
  107.     void VBE_set_scanline_length(long newcx);
  108.     void VBE_set_offset(long x,long y);
  109.  
  110.     extern VesaInfoBlock vesabuf;
  111.     extern VesaModeInfo modebuf;
  112.     extern VesaSystem VESA;
  113.  
  114.     #ifdef __cplusplus
  115. }
  116. #endif
  117. #endif
  118.  
  119.  
  120.